//
//  LabelTextFieldView.m
//  LeanCloudTestUser
//
//  Created by lanou3g on 16/2/27.
//  Copyright © 2016年 LeanCloud. All rights reserved.
//

#import "LabelTextFieldView.h"

@implementation LabelTextFieldView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addAllViwes];
    }
    return self;
}

- (void)addAllViwes
{
    self.LTLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width * 0.3, self.frame.size.height)];
    self.LTLabel.font = [UIFont systemFontOfSize:15.0f];
    [self addSubview:self.LTLabel];
    
    self.LTTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.LTLabel.frame), 0, self.frame.size.width * 0.7, self.frame.size.height)];
    self.LTTextField.borderStyle = UITextBorderStyleRoundedRect;
    self.LTTextField.clearButtonMode = UITextFieldViewModeAlways;
    self.LTTextField.backgroundColor = [UIColor clearColor];
    [self addSubview:self.LTTextField];
}

- (void)setLabelText:(NSString *)labelText textFieldPlaceholder:(NSString *)placeholder isCiphertext:(BOOL)isCiphertext textFieldTag:(NSInteger)tag
{
    self.LTLabel.text = labelText;
    self.LTTextField.placeholder = placeholder;
    self.LTTextField.secureTextEntry = isCiphertext;
    self.LTTextField.tag = tag;
}

- (void)setTextFieldTag:(NSInteger)tag
{
    self.LTTextField.tag = tag;
}

@end
